@include('layouts.Common.header')
<link rel="stylesheet" href="/plugins/fontawesome-iconpicker/dist/css/fontawesome-iconpicker.min.css">
<!-- jQuery -->
<script src="/plugins/fontawesome-iconpicker/dist/js/fontawesome-iconpicker.min.js"></script>
<style>
    .fade:not(.show) {
        opacity: 1;
    }

</style>
<form name="actionForm" id="actionForm" class="_autoheight" method="post" autocomplete="off">
    @csrf
    <div class="form-group row">
        <label class="col-sm-2  col-form-label text-right">父菜单：</label>
        <div class="col-sm-8">
            <div class="selectparent"></div>
        </div>
    </div>
    <div class="form-group row">
        <label class="col-sm-2  col-form-label text-right">图像：</label>
        <div class="col-sm-8">
            <input type="text" id=iconpik class="form-control" name='data[icon]'
                value="{{ isset($gdata['icon']) ? $gdata['icon'] : '' }}" placeholder="">
        </div>
    </div>
    <div class="form-group row">
        <label class="col-sm-2  col-form-label text-right"><i>*</i>菜单名称：</label>
        <div class="col-sm-8">
            <input type="text" class="form-control" name="data[name]"
                value="{{ isset($gdata['name']) ? $gdata['name'] : '' }}" placeholder="">
        </div>
    </div>
    <div class="form-group row">
        <label class="col-sm-2  col-form-label text-right">链接地址：</label>
        <div class="col-sm-8">
            <input type="text" class="form-control" name="data[url]"
                value="{{ isset($gdata['url']) ? $gdata['url'] : '' }}" placeholder="">
        </div>
    </div>

    <div class="form-group row">
        <label class="col-sm-2  col-form-label text-right">排序：</label>
        <div class="col-sm-8">
            <input type="text" class="form-control" name="data[sort]"
                value="{{ isset($gdata['sort']) ? $gdata['sort'] : '' }}" placeholder="">
        </div>
    </div>
    <div class="form-group row">
        <label class="col-sm-2  col-form-label text-right">启用：</label>
        <div class="col-sm-8">
            <input type="checkbox" class="Switch" name="data[display]"
                value="{{ isset($gdata['display']) ? $gdata['display'] : '' }}" checked data-bootstrap-switch
                data-off-color="danger" data-on-color="success">
        </div>
    </div>
    <input type="dosubmit" id="dosubmit" name="dosubmit" hidden />
</form>

{!! js() !!}
<script>
    $(function() {
        $('#iconpik').iconpicker();
        $(".selectparent").select({!! json_encode($selectdata) !!});
        $(".Switch").bootstrapSwitch('state', $(".Switch").prop('checked'));
    })
</script>
